{% extends "base.html" %}

{% block css %}
<link rel="stylesheet" type="text/css" href="/statics/css/booking.css" />
{% endblock %}

{% block javascript %}
<script type="text/javascript" src="/statics/javascript/booking.js"></script>
<script type="text/javascript" src="/statics/javascript/jquery.blockUI.js"></script>
<script type="text/javascript">
    $(function(){
        $('#search_btn').click(function(){
            if ($('#emp_id').val() != null){
                window.location = '/mybooking/' + $('#emp_id').val();
            }
        });
    });
</script>
{% endblock %}

{% block title %}我的订单{% endblock %}

{% block content %}
<h1>我的订单</h1>
{% if manCharge %}
<h2>温馨提示:如果你没交钱，麻烦你尽快去交钱,今天请把钱交给<a href="/user">{{manCharge}}</a></h2>
{% else %}
<h2><a href="/user">今天把钱交给谁呢?</a></h2>
{% endif %}
{% if not user %}
员工号:<input id="emp_id" name="emp_id"/> <button id="search_btn">查询</button>
{% else %}
    姓名:{{user.name}}({{user.code}})
{% endif %}
<table width="300" border="1" style="border-collapse: collapse">
{% if orders %}
    {% for order in orders %}
    <tr align="center" {%ifequal order.date today%}background="blue"{%endifequal%}>
       <td>{{ order.date }}</td>
       <td>{{ order.dish.name }}</td>
       <td>{{ order.dish.price }}</td>
       <td><a href="/mybooking/del/{{user.code}}/{{order.key}}">取消</a></td>
    </tr>
    {% endfor %}
{% endif %}
</table>
总金额: {{ total_price }}<br/>
{% if user %}
<a href="/mybooking/list/{{user.code}}">历史订单</a>
{% endif %}
{% endblock %}